import {Service} from "adajs";
import {format} from "./../../../lib/helper";

class LodgeService extends Service {
    defaultData() {
        return {
            list: []
        }
    }

    onupdate(current, {list}) {
        current.list = list.map(item => {
            return Object.assign({}, item, {
                time: item.hjsj ? format(new Date(item.hjsj.replace(/\-/g,"/")),'yyyy-MM-dd') : '--'
            })
        });
    }
}

export default LodgeService;